<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<%@ taglib uri="http://www.atg.com/taglibs/daf/dspjspTaglib1_0"
	prefix="dsp"%>
<dsp:page>

		<dsp:importbean bean="/atg/commerce/catalog/ProductLookup"/>
		<dsp:importbean bean="/atg/userprofiling/ProfileFormHandler" />
		<dsp:importbean bean="/atg/dynamo/droplet/Switch" />
		<dsp:importbean bean="/atg/dynamo/droplet/ErrorMessageForEach" />
		<dsp:importbean bean="/atg/commerce/catalog/CategoryLookup" />
		<dsp:importbean bean="/atg/dynamo/droplet/ForEach" />
		<dsp:importbean bean="/atg/commerce/pricing/PriceEachItem" />
		<dsp:importbean bean="atg.commerce.pricing.ItemPriceInfo"/>
		<dsp:importbean bean="/atg/commerce/order/ShoppingCartModifier"/>
		<dsp:importbean bean="/atg/commerce/payment/CreditCardTools"/>
		<dsp:importbean bean="/atg/commerce/order/purchase/CommitOrderFormHandler"/>
		<dsp:importbean bean="/atg/commerce/order/OrderLookup"/>
		<dsp:importbean bean="/atg/userprofiling/Profile"/>
		
	<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<%@include file="style.jspf"%>
<title>Course</title>
	</head>
	<body>
		<div id="wrap" class="clear-block">
			<div id="header"><jsp:include page="header.jsp" /></div>
	
			<h3>Order History</h3>
			<div class="orderHsy">

			

        <dsp:getvalueof var="isNotLogin" bean="Profile.transient"/>
			<c:choose>
					<c:when test='${isNotLogin}' >
						  <p> Please Login.</p>
					 </c:when>
					 <c:otherwise>
								  	 
			                 	

				 <dsp:droplet name="OrderLookup">
                	<dsp:param name="userId" bean="Profile.id"/>
					<dsp:oparam name="output">
					    	<dsp:getvalueof var="noOrder" param="empty"/>	
							<c:choose>
			                 	<c:when test='${noOrder}' >
									  <p> &lt;No orders&gt;.</p>
			                 	 </c:when>
			                 	 <c:otherwise>
									<p>Please select an order to see its detail. </p>    	 
			                 	</c:otherwise>
		                 	 </c:choose>
						
							<div class="listBox">
								<ul class="head">
									<li class="item">Order Date</li>
									<li class="qty">Order #</li>
									<li class="actions">Status</li>
								</ul>
							</div>
                   		<dsp:droplet name="ForEach">
                    	<dsp:param name="array" param="result"/>
						<dsp:param name="elementName" value="order" />
                    	      <dsp:oparam name="output">
								<div class="listBox">
		                    	<ul>
		                    		<li class="item">
		                    		 <p class="date">
									   	 <dsp:valueof param="order.creationDate" date="mm/dd/yyyy"></dsp:valueof>
										
		                    		 </p>
		                       		</li>
									
		                            <li class="qty">
							            <dsp:a href="orderDetail.jsp" iclass="underline">
											<dsp:param name="orderdate" param="order.creationDate"/>
											<dsp:param name="orderno" param="order.description"/>
											<dsp:param name="orderstate" param="order.StateasString"/>
											<dsp:param name="orderID" param="order.id"/>
											<dsp:valueof param="order.description"></dsp:valueof>
										</dsp:a>
		                            </li>     
		                            <li class="price">
		                            	<dsp:valueof param="order.StateasString"></dsp:valueof>
		                            </li>
		                    	</ul>
		                    	</div>
		                    	</dsp:oparam>
							</dsp:droplet>
						</dsp:oparam>		
                    
 
                </dsp:droplet>
				</c:otherwise>
			</c:choose>
<!--
				<div class="listBox">
					<ul>
						<li class="item">2/14/2012</li>
						<li class="qty"><a href="orderDetail.jsp" class="underline">222222</a></li>
						<li class="actions">Shipped</li>
					</ul>
				</div>

				<div class="listBox">
					<ul>
						<li class="item">12/20/2011</li>
						<li class="qty"><a href="orderDetail.jsp" class="underline">111111</a></li>
						<li class="actions">Completed</li>
					</ul>
				</div>
-->
			</div>
			<div id="footer"><jsp:include page="footer.jsp" /></div>
		</div>
	</body>
</dsp:page>
</html>